#ifndef MYTOOLS_HPP_INCLUDED
#define MYTOOLS_HPP_INCLUDED 1
// Include
#include<windows.h>
#include<GL/gl.h>
#include<GL/glu.h>
#include<GL/glut.h>
//#include<GL/glext.h>
//#pragma comment(lib,"glaux.lib")
//#include<GL/glaux.h>
//#include<GL/SOIL.h>
//#include"CImg.h"
//#include"./EasyBMP.h"
//#include<stdlib.h>
//#include<math.h>
#include<string.h>
#include<iostream>
#include<fstream>
#include<sstream>
//#include<string>

//#define DEBUG
//#define TEXTURE
#ifndef TEXTURE
#define MATERIAL
#endif //TEXTURE

// Type Define
//纹理文件
typedef char* detail_file_mt;
//材质
typedef struct material_ {
    GLuint texture;
    GLint index;
    GLfloat ambient[4];
    GLfloat diffuse[4];
    GLfloat specular[4];
    GLfloat emission[4];
    GLfloat shininess;
} material_mt;
//顶点坐标
typedef GLfloat* vertex_coordinate_mt;
//贴图坐标
typedef GLfloat* chartlet_coordinate_mt;
//法线
typedef GLfloat* normal_coordinate_mt;
//三角形坐标
typedef unsigned int* submodel_triangle_mt;
//模型分组
typedef struct submodel_mt_ {
    GLint triangleNumber, materialIndex;
    submodel_triangle_mt* triangles;
} submodel_mt;
//所有数据
typedef struct database_ {
    GLint Num_detailfile = 0, Num_material = 0, Num_vertex = 0, Num_chartlet = 0, Num_normal = 0, Num_submodel = 0;
    GLfloat scale[3] = {0.0, 0.0, 0.0};
    detail_file_mt* DetailFile_Set = nullptr;
    material_mt* Material_Set = nullptr;
    vertex_coordinate_mt* Vertex_Set = nullptr;
    chartlet_coordinate_mt* Chartlet_Set = nullptr;
    normal_coordinate_mt* Normal_Dirc_Set = nullptr;
    submodel_mt* Submodel_Set = nullptr;
} database_mt;
// Constants

// Tool functions
int weight( int c );
void mygetData( void );
void loadTextureFile( void );
#endif // MYTOOLS_HPP_INCLUDED
